package day07Test;

public class Test2 {
    public static void main(String[] args) {
        int count = 0;
        for (int i = 2; i < 200; i++) {
            boolean flag = true;

            for (int j = 2; j < i; j++) {
                if(i % j == 0){
                    flag = false;
                    break;
                }
            }
            if (flag){
                count++;
                System.out.println("当前数字" + i +"是一个质数" );

            }/*else {
                //System.out.println("当前数字" + i +"不是一个质数" );
            }*/

        }
        System.out.println("一共有" + count +"个质数");

    }
}
